package com.iotechn.unimall.data.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.iotechn.unimall.data.domain.RefundOrderDO;
import com.iotechn.unimall.data.dto.excel.SkuUnitPriceDTO;
import com.iotechn.unimall.data.dto.order.OrderDTO;
import com.iotechn.unimall.data.dto.order.OrderRefundDTO;
import com.iotechn.unimall.data.dto.statistics.PayChannelDTO;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * Created by rize on 2019/7/6.
 */
public interface RefundOrderMapper extends BaseMapper<RefundOrderDO> {

    //门店订单列表
    List<OrderRefundDTO> pageStoreRefundOrders(@Param("keyword") String keyword, @Param("offset") Integer offset, @Param("limit") Integer limit, @Param("storeId") Long storeId, @Param("startTime") String startTime, @Param("endTime") String endTime);

    //门店订单统计
    Integer countStoreRefundOrders(@Param("keyword") String keyword, @Param("storeId") Long storeId, @Param("startTime") String startTime, @Param("endTime") String endTime);

    //汇总退单为订单
    List<OrderDTO> summaryRefundOrderByPara(@Param("storeId") Long storeId, @Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("isOnline") Integer isOnline);

    //汇总退款
    List<PayChannelDTO> summaryPayChannelRefundOrder(@Param("storeId") Long storeId, @Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("isOnline") Integer isOnline);
    //汇总退款
    List<PayChannelDTO> summaryPayChannelRefundOrderNew(@Param("storeId") Long storeId, @Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("isOnline") Integer isOnline);

    //门店退单统计
    List<SkuUnitPriceDTO> storeReturnStatistics(@Param("startTime") Date startTime,@Param("storeId") Long storeId,@Param("skuIds") List<Long> skuIds);


    /** 线下退单金额 根据退单渠道  区分现金 与 余额  */
    PayChannelDTO offlineRefund(@Param("refundChannel") String refundChannel,@Param("startTime") Date startTime,@Param("endTime") Date endTime,@Param("storeId") Long storeId);
    /** 线下退单金额 根据退单渠道  区分现金 与 余额  */
    List<PayChannelDTO> offlineRefundDay(@Param("refundChannel") String refundChannel,@Param("startTime") Date startTime,@Param("endTime") Date endTime,@Param("storeId") Long storeId);
}
